package com.sensoro.qrgun.dialog;

import com.sensoro.qrgun.R;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class SelectDialog extends Dialog implements OnClickListener {

	Button weixinBtn;
	Button tietiaoBtn;
	Button tongyiBtn;
	SelectListener listener;

	public interface SelectListener {
		public void onSucceed(int flage);
	}

	public SelectDialog(Context context, SelectListener listener) {

		super(context);
		this.listener = listener;
		setContentView(R.layout.dialog_addtag);
		weixinBtn = (Button) findViewById(R.id.weixin_btn);
		tietiaoBtn = (Button) findViewById(R.id.tietiao_btn);
		tongyiBtn = (Button) findViewById(R.id.tongyi_btn);
		weixinBtn.setOnClickListener(this);
		tietiaoBtn.setOnClickListener(this);
		tongyiBtn.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.weixin_btn:
			listener.onSucceed(0);
			SelectDialog.this.dismiss();
			break;
		case R.id.tietiao_btn:
			listener.onSucceed(1);
			SelectDialog.this.dismiss();
			break;
		case R.id.tongyi_btn:
			listener.onSucceed(2);
			SelectDialog.this.dismiss();
			break;

		default:
			break;
		}
	}
}
